using System;
using System.ComponentModel;
using System.Data.Services.Client;
using System.Diagnostics;
using OrbitOne.CRMLyncInfoDashboard.CRM.OrganizationData;


namespace OrbitOne.CRMLyncInfoDashboard.CRM.OData
{
    [DebuggerDisplay("Account: {Id} {Name}")]
    public class AccountModel : IEntityModel
    {
        private readonly Account m_account;

        public EntityModelTypes ModelType
        {
            get { return EntityModelTypes.AccountModel; }
        }

        public AccountModel(Account account)
        {
            m_account = account;
        }

        public AccountModel(): this(new Account())
        {}

        public  Guid Id
        {
            get { return m_account.AccountId; }
        }

        public  string DisplayText
        {
            get { return Name; }
        }

        public int SequenceNumber
        {
            get { return 1; }
        }

        public EntitytMetadataModel Metadata { get; set; }

        public OptionSetValue TerritoryCode
        {
            get { return m_account.TerritoryCode; }
            set { m_account.TerritoryCode = value; }
        }

        public DateTime? LastUsedInCampaign
        {
            get { return m_account.LastUsedInCampaign; }
            set { m_account.LastUsedInCampaign = value; }
        }

        public string Address1_Name
        {
            get { return m_account.Address1_Name; }
            set { m_account.Address1_Name = value; }
        }

        public string Address1_Telephone2
        {
            get { return m_account.Address1_Telephone2; }
            set { m_account.Address1_Telephone2 = value; }
        }

        public string orb_lyncsearchfield
        {
            get { return m_account.orb_lyncsearchfield; }
            set { m_account.orb_lyncsearchfield = value; }
        }

        public DateTime? OverriddenCreatedOn
        {
            get { return m_account.OverriddenCreatedOn; }
            set { m_account.OverriddenCreatedOn = value; }
        }

        public OptionSetValue PreferredContactMethodCode
        {
            get { return m_account.PreferredContactMethodCode; }
            set { m_account.PreferredContactMethodCode = value; }
        }

        public OptionSetValue OwnershipCode
        {
            get { return m_account.OwnershipCode; }
            set { m_account.OwnershipCode = value; }
        }

        public EntityReference PrimaryContactId
        {
            get { return m_account.PrimaryContactId; }
            set { m_account.PrimaryContactId = value; }
        }

        public Money CreditLimit
        {
            get { return m_account.CreditLimit; }
            set { m_account.CreditLimit = value; }
        }

        public EntityReference TerritoryId
        {
            get { return m_account.TerritoryId; }
            set { m_account.TerritoryId = value; }
        }

        public string Telephone3
        {
            get { return m_account.Telephone3; }
            set { m_account.Telephone3 = value; }
        }

        public bool? DoNotBulkPostalMail
        {
            get { return m_account.DoNotBulkPostalMail; }
            set { m_account.DoNotBulkPostalMail = value; }
        }

        public OptionSetValue Address1_FreightTermsCode
        {
            get { return m_account.Address1_FreightTermsCode; }
            set { m_account.Address1_FreightTermsCode = value; }
        }

        public string Address2_Line1
        {
            get { return m_account.Address2_Line1; }
            set { m_account.Address2_Line1 = value; }
        }

        public string EMailAddress2
        {
            get { return m_account.EMailAddress2; }
            set { m_account.EMailAddress2 = value; }
        }

        public string Address2_PrimaryContactName
        {
            get { return m_account.Address2_PrimaryContactName; }
            set { m_account.Address2_PrimaryContactName = value; }
        }

        public string Telephone2
        {
            get { return m_account.Telephone2; }
            set { m_account.Telephone2 = value; }
        }

        public int? TimeZoneRuleVersionNumber
        {
            get { return m_account.TimeZoneRuleVersionNumber; }
            set { m_account.TimeZoneRuleVersionNumber = value; }
        }

        public EntityReference OwningTeam
        {
            get { return m_account.OwningTeam; }
            set { m_account.OwningTeam = value; }
        }

      /*  public string new_Code
        {
            get { return m_account.new_Code; }
            set { m_account.new_Code = value; }
        }*/

        public OptionSetValue ShippingMethodCode
        {
            get { return m_account.ShippingMethodCode; }
            set { m_account.ShippingMethodCode = value; }
        }

        public Guid? Address1_AddressId
        {
            get { return m_account.Address1_AddressId; }
            set { m_account.Address1_AddressId = value; }
        }

        public string Address2_Telephone1
        {
            get { return m_account.Address2_Telephone1; }
            set { m_account.Address2_Telephone1 = value; }
        }

        public string Address1_Fax
        {
            get { return m_account.Address1_Fax; }
            set { m_account.Address1_Fax = value; }
        }

        public EntityReference OwningBusinessUnit
        {
            get { return m_account.OwningBusinessUnit; }
            set { m_account.OwningBusinessUnit = value; }
        }

        public EntityReference OwnerId
        {
            get { return m_account.OwnerId; }
            set { m_account.OwnerId = value; }
        }

        public EntityReference CreatedOnBehalfBy
        {
            get { return m_account.CreatedOnBehalfBy; }
            set { m_account.CreatedOnBehalfBy = value; }
        }

        public double? Address2_Latitude
        {
            get { return m_account.Address2_Latitude; }
            set { m_account.Address2_Latitude = value; }
        }

        public Money Aging90_Base
        {
            get { return m_account.Aging90_Base; }
            set { m_account.Aging90_Base = value; }
        }

        public string Address2_PostalCode
        {
            get { return m_account.Address2_PostalCode; }
            set { m_account.Address2_PostalCode = value; }
        }

        public bool? Merged
        {
            get { return m_account.Merged; }
            set { m_account.Merged = value; }
        }

        public OptionSetValue PaymentTermsCode
        {
            get { return m_account.PaymentTermsCode; }
            set { m_account.PaymentTermsCode = value; }
        }

        public bool? DoNotSendMM
        {
            get { return m_account.DoNotSendMM; }
            set { m_account.DoNotSendMM = value; }
        }

        public string Address2_County
        {
            get { return m_account.Address2_County; }
            set { m_account.Address2_County = value; }
        }

        public Money Aging30
        {
            get { return m_account.Aging30; }
            set { m_account.Aging30 = value; }
        }

        public string Address2_City
        {
            get { return m_account.Address2_City; }
            set { m_account.Address2_City = value; }
        }

        public bool? DoNotBulkEMail
        {
            get { return m_account.DoNotBulkEMail; }
            set { m_account.DoNotBulkEMail = value; }
        }

        public int? ImportSequenceNumber
        {
            get { return m_account.ImportSequenceNumber; }
            set { m_account.ImportSequenceNumber = value; }
        }

        public string EMailAddress3
        {
            get { return m_account.EMailAddress3; }
            set { m_account.EMailAddress3 = value; }
        }

        public string Address1_City
        {
            get { return m_account.Address1_City; }
            set { m_account.Address1_City = value; }
        }

        public string WebSiteURL
        {
            get { return m_account.WebSiteURL; }
            set { m_account.WebSiteURL = value; }
        }

        public Money Revenue
        {
            get { return m_account.Revenue; }
            set { m_account.Revenue = value; }
        }

        public EntityReference TransactionCurrencyId
        {
            get { return m_account.TransactionCurrencyId; }
            set { m_account.TransactionCurrencyId = value; }
        }

        public OptionSetValue Address1_ShippingMethodCode
        {
            get { return m_account.Address1_ShippingMethodCode; }
            set { m_account.Address1_ShippingMethodCode = value; }
        }

        public string Address1_PostOfficeBox
        {
            get { return m_account.Address1_PostOfficeBox; }
            set { m_account.Address1_PostOfficeBox = value; }
        }

        public string Description
        {
            get { return m_account.Description; }
            set { m_account.Description = value; }
        }

        public string TickerSymbol
        {
            get { return m_account.TickerSymbol; }
            set { m_account.TickerSymbol = value; }
        }

        public double? Address2_Longitude
        {
            get { return m_account.Address2_Longitude; }
            set { m_account.Address2_Longitude = value; }
        }

        public string SIC
        {
            get { return m_account.SIC; }
            set { m_account.SIC = value; }
        }

        public string Address1_County
        {
            get { return m_account.Address1_County; }
            set { m_account.Address1_County = value; }
        }

        public EntityReference OwningUser
        {
            get { return m_account.OwningUser; }
            set { m_account.OwningUser = value; }
        }

        public string Address1_Line1
        {
            get { return m_account.Address1_Line1; }
            set { m_account.Address1_Line1 = value; }
        }

        public Guid? Address2_AddressId
        {
            get { return m_account.Address2_AddressId; }
            set { m_account.Address2_AddressId = value; }
        }

        public Money CreditLimit_Base
        {
            get { return m_account.CreditLimit_Base; }
            set { m_account.CreditLimit_Base = value; }
        }

        public EntityReference PreferredSystemUserId
        {
            get { return m_account.PreferredSystemUserId; }
            set { m_account.PreferredSystemUserId = value; }
        }

        public Money MarketCap
        {
            get { return m_account.MarketCap; }
            set { m_account.MarketCap = value; }
        }

        public string Address1_PrimaryContactName
        {
            get { return m_account.Address1_PrimaryContactName; }
            set { m_account.Address1_PrimaryContactName = value; }
        }

        public bool? DoNotPostalMail
        {
            get { return m_account.DoNotPostalMail; }
            set { m_account.DoNotPostalMail = value; }
        }

        public OptionSetValue AccountCategoryCode
        {
            get { return m_account.AccountCategoryCode; }
            set { m_account.AccountCategoryCode = value; }
        }

        public OptionSetValue StateCode
        {
            get { return m_account.StateCode; }
            set { m_account.StateCode = value; }
        }

        public string Address2_Telephone3
        {
            get { return m_account.Address2_Telephone3; }
            set { m_account.Address2_Telephone3 = value; }
        }

        public OptionSetValue Address2_AddressTypeCode
        {
            get { return m_account.Address2_AddressTypeCode; }
            set { m_account.Address2_AddressTypeCode = value; }
        }

        public bool? DoNotFax
        {
            get { return m_account.DoNotFax; }
            set { m_account.DoNotFax = value; }
        }

        public EntityReference DefaultPriceLevelId
        {
            get { return m_account.DefaultPriceLevelId; }
            set { m_account.DefaultPriceLevelId = value; }
        }

        public bool? ParticipatesInWorkflow
        {
            get { return m_account.ParticipatesInWorkflow; }
            set { m_account.ParticipatesInWorkflow = value; }
        }

        public OptionSetValue CustomerSizeCode
        {
            get { return m_account.CustomerSizeCode; }
            set { m_account.CustomerSizeCode = value; }
        }

        public string Address2_UPSZone
        {
            get { return m_account.Address2_UPSZone; }
            set { m_account.Address2_UPSZone = value; }
        }

        public EntityReference PreferredServiceId
        {
            get { return m_account.PreferredServiceId; }
            set { m_account.PreferredServiceId = value; }
        }

        public int? UTCConversionTimeZoneCode
        {
            get { return m_account.UTCConversionTimeZoneCode; }
            set { m_account.UTCConversionTimeZoneCode = value; }
        }

        public bool? DoNotEMail
        {
            get { return m_account.DoNotEMail; }
            set { m_account.DoNotEMail = value; }
        }

        public Money Aging60
        {
            get { return m_account.Aging60; }
            set { m_account.Aging60 = value; }
        }

        public OptionSetValue CustomerTypeCode
        {
            get { return m_account.CustomerTypeCode; }
            set { m_account.CustomerTypeCode = value; }
        }

        public string Telephone1
        {
            get { return m_account.Telephone1; }
            set { m_account.Telephone1 = value; }
        }

        public EntityReference CreatedBy
        {
            get { return m_account.CreatedBy; }
            set { m_account.CreatedBy = value; }
        }

        public string Address2_Name
        {
            get { return m_account.Address2_Name; }
            set { m_account.Address2_Name = value; }
        }

        public EntityReference ModifiedBy
        {
            get { return m_account.ModifiedBy; }
            set { m_account.ModifiedBy = value; }
        }

        public string YomiName
        {
            get { return m_account.YomiName; }
            set { m_account.YomiName = value; }
        }

        public string Address2_Country
        {
            get { return m_account.Address2_Country; }
            set { m_account.Address2_Country = value; }
        }

        public string Address2_Fax
        {
            get { return m_account.Address2_Fax; }
            set { m_account.Address2_Fax = value; }
        }

        public string Address1_UPSZone
        {
            get { return m_account.Address1_UPSZone; }
            set { m_account.Address1_UPSZone = value; }
        }

        public string Address1_PostalCode
        {
            get { return m_account.Address1_PostalCode; }
            set { m_account.Address1_PostalCode = value; }
        }

        public string Address1_Country
        {
            get { return m_account.Address1_Country; }
            set { m_account.Address1_Country = value; }
        }

        public int? NumberOfEmployees
        {
            get { return m_account.NumberOfEmployees; }
            set { m_account.NumberOfEmployees = value; }
        }

        public OptionSetValue Address2_FreightTermsCode
        {
            get { return m_account.Address2_FreightTermsCode; }
            set { m_account.Address2_FreightTermsCode = value; }
        }

        public OptionSetValue AccountRatingCode
        {
            get { return m_account.AccountRatingCode; }
            set { m_account.AccountRatingCode = value; }
        }

        public string FtpSiteURL
        {
            get { return m_account.FtpSiteURL; }
            set { m_account.FtpSiteURL = value; }
        }

        public double? Address1_Longitude
        {
            get { return m_account.Address1_Longitude; }
            set { m_account.Address1_Longitude = value; }
        }
        
        public EntityReference OriginatingLeadId
        {
            get { return m_account.OriginatingLeadId; }
            set { m_account.OriginatingLeadId = value; }
        }

        public string Fax
        {
            get { return m_account.Fax; }
            set { m_account.Fax = value; }
        }

        public bool? CreditOnHold
        {
            get { return m_account.CreditOnHold; }
            set { m_account.CreditOnHold = value; }
        }

        public string Address1_Telephone1
        {
            get { return m_account.Address1_Telephone1; }
            set { m_account.Address1_Telephone1 = value; }
        }

        public DateTime? CreatedOn
        {
            get { return m_account.CreatedOn; }
            set { m_account.CreatedOn = value; }
        }

        public string Name
        {
            get { return m_account.Name; }
            set { m_account.Name = value; }
        }

        public decimal? ExchangeRate
        {
            get { return m_account.ExchangeRate; }
            set { m_account.ExchangeRate = value; }
        }

        public OptionSetValue Address2_ShippingMethodCode
        {
            get { return m_account.Address2_ShippingMethodCode; }
            set { m_account.Address2_ShippingMethodCode = value; }
        }

        public string Address2_Line2
        {
            get { return m_account.Address2_Line2; }
            set { m_account.Address2_Line2 = value; }
        }

        public long? VersionNumber
        {
            get { return m_account.VersionNumber; }
            set { m_account.VersionNumber = value; }
        }

        public string AccountNumber
        {
            get { return m_account.AccountNumber; }
            set { m_account.AccountNumber = value; }
        }

        public string Address2_PostOfficeBox
        {
            get { return m_account.Address2_PostOfficeBox; }
            set { m_account.Address2_PostOfficeBox = value; }
        }

        public Money Revenue_Base
        {
            get { return m_account.Revenue_Base; }
            set { m_account.Revenue_Base = value; }
        }

        public bool? DoNotPhone
        {
            get { return m_account.DoNotPhone; }
            set { m_account.DoNotPhone = value; }
        }

        public OptionSetValue AccountClassificationCode
        {
            get { return m_account.AccountClassificationCode; }
            set { m_account.AccountClassificationCode = value; }
        }

        public EntityReference PreferredEquipmentId
        {
            get { return m_account.PreferredEquipmentId; }
            set { m_account.PreferredEquipmentId = value; }
        }

        public Money MarketCap_Base
        {
            get { return m_account.MarketCap_Base; }
            set { m_account.MarketCap_Base = value; }
        }

        public string Address2_Telephone2
        {
            get { return m_account.Address2_Telephone2; }
            set { m_account.Address2_Telephone2 = value; }
        }

        public OptionSetValue Address1_AddressTypeCode
        {
            get { return m_account.Address1_AddressTypeCode; }
            set { m_account.Address1_AddressTypeCode = value; }
        }

        public int? Address1_UTCOffset
        {
            get { return m_account.Address1_UTCOffset; }
            set { m_account.Address1_UTCOffset = value; }
        }

        public EntityReference ParentAccountId
        {
            get { return m_account.ParentAccountId; }
            set { m_account.ParentAccountId = value; }
        }

        public string Address1_Line2
        {
            get { return m_account.Address1_Line2; }
            set { m_account.Address1_Line2 = value; }
        }

        public OptionSetValue BusinessTypeCode
        {
            get { return m_account.BusinessTypeCode; }
            set { m_account.BusinessTypeCode = value; }
        }

        public Money Aging60_Base
        {
            get { return m_account.Aging60_Base; }
            set { m_account.Aging60_Base = value; }
        }

        public EntityReference ModifiedOnBehalfBy
        {
            get { return m_account.ModifiedOnBehalfBy; }
            set { m_account.ModifiedOnBehalfBy = value; }
        }

        public string StockExchange
        {
            get { return m_account.StockExchange; }
            set { m_account.StockExchange = value; }
        }

        public string Address1_Line3
        {
            get { return m_account.Address1_Line3; }
            set { m_account.Address1_Line3 = value; }
        }

        public EntityReference MasterId
        {
            get { return m_account.MasterId; }
            set { m_account.MasterId = value; }
        }

        public Money Aging90
        {
            get { return m_account.Aging90; }
            set { m_account.Aging90 = value; }
        }

        public OptionSetValue StatusCode
        {
            get { return m_account.StatusCode; }
            set { m_account.StatusCode = value; }
        }

        public Money Aging30_Base
        {
            get { return m_account.Aging30_Base; }
            set { m_account.Aging30_Base = value; }
        }

        public int? SharesOutstanding
        {
            get { return m_account.SharesOutstanding; }
            set { m_account.SharesOutstanding = value; }
        }

        public string Address1_StateOrProvince
        {
            get { return m_account.Address1_StateOrProvince; }
            set { m_account.Address1_StateOrProvince = value; }
        }

        public double? Address1_Latitude
        {
            get { return m_account.Address1_Latitude; }
            set { m_account.Address1_Latitude = value; }
        }

        public DateTime? ModifiedOn
        {
            get { return m_account.ModifiedOn; }
            set { m_account.ModifiedOn = value; }
        }

        public string Address2_Line3
        {
            get { return m_account.Address2_Line3; }
            set { m_account.Address2_Line3 = value; }
        }

        public int? Address2_UTCOffset
        {
            get { return m_account.Address2_UTCOffset; }
            set { m_account.Address2_UTCOffset = value; }
        }

        public OptionSetValue PreferredAppointmentDayCode
        {
            get { return m_account.PreferredAppointmentDayCode; }
            set { m_account.PreferredAppointmentDayCode = value; }
        }

        public OptionSetValue PreferredAppointmentTimeCode
        {
            get { return m_account.PreferredAppointmentTimeCode; }
            set { m_account.PreferredAppointmentTimeCode = value; }
        }

        public string EMailAddress1
        {
            get { return m_account.EMailAddress1; }
            set { m_account.EMailAddress1 = value; }
        }

        public string Address2_StateOrProvince
        {
            get { return m_account.Address2_StateOrProvince; }
            set { m_account.Address2_StateOrProvince = value; }
        }

        public OptionSetValue IndustryCode
        {
            get { return m_account.IndustryCode; }
            set { m_account.IndustryCode = value; }
        }

        public string Address1_Telephone3
        {
            get { return m_account.Address1_Telephone3; }
            set { m_account.Address1_Telephone3 = value; }
        }

        public DataServiceCollection<Lead> accountleads_association
        {
            get { return m_account.accountleads_association; }
            set { m_account.accountleads_association = value; }
        }

       
        public override string ToString()
        {
            return string.Format("{0}: {1}", Id, Name);
        }


    }
}
